<!-- 主页头部组件 -->
<template>
  <div class="root">
    <div class="box">
      <div class="left">
        <span class="fa fa-map-marker" style="padding-top:4px;">&nbsp;</span>
        <span class="span1">{{positionInfo.name}}</span>
      </div>
  
      <div class="right">
        <div class="span">
          <span>{{weather.temperature}}°</span>
          <br/>
          <span>{{weather.description}}</span>
        </div>
        <img :src='this.weather.image_hash|isf'>
      </div>
    </div>

    <input type="text" placeholder="搜索商家、商品">
    <!--<h1>2345668</h1>-->
      <!-- 未报错，页面不显示  -->
      <Scroller lock-y scrollbar-x v-if='hotSearch.length>0'>
        <div class="hot">
          <a href="/" v-for='item in hotSearch' class='item'>{{item.word}}</a>
        </div>
      </Scroller>
  
  </div>
</template>

<script>
import { Scroller } from 'vux'
export default {
  props: ['positionInfo', 'weather', 'hotSearch'],
  components: {
    Scroller
  }
}
</script>

<style scoped>
.root {
  background-color: #0096FF;
  padding: 10px;
}

.box {
  display: flex;
  font-size: 16px;
  justify-content: space-between;
}

.left {
  display: flex;
  color: white;
}

.span1 {
  flex-basis: 56%;
  /*border: 1px solid black;*/
  /*设置文本多余的显示成三个点 */
  overflow: hidden;
  white-space: nowrap;
  /*display: inline-block;*/
  text-overflow: ellipsis;
}

.left .span1 {
  display: inline-block;
  margin: 0px;
}

.right {
  display: flex;
}

.right .span {
  color: white;
  font-size: 10px;
  margin: 0;
  /*border: 1px solid blue;*/
}

.right img {
  width: 18px;
  height: 40px;
  margin-left:2px;
}

input {
  margin: 8px 0;
  height: 30px;
  width: 100%;
  border-radius: 18px;
  border: none;
  text-align: center;
  font-size: 14px;
}

.hot {
  white-space: nowrap;
  display: inline-block;
}
.item {
  text-decoration: none;
  margin: 0 8px;
  font-size: 14px;
}
a{
  color: white;
}
</style>
